AWSTemplateFormatVersion: 2010-09-09
Description: >-
  about-me-api

Transform:
  - AWS::Serverless-2016-10-31

Resources:
  createEmailFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: src/handler.Handler
      Runtime: nodejs18.x
      Architectures:
        - x86_64
      MemorySize: 128
      Timeout: 100
      Description: lorem ipsum description
      Policies:
        - AmazonSESFullAccess
      Events:
        Api:
          Type: Api
          Properties:
            Path: /email
            Method: POST
      Environment:
        Variables:
          TO_EMAIL: 'your_to_email'
          SOURCE_EMAIL: 'your_source_email'
          ALLOW_ORIGIN: 'https://zubogain.github.io'

Outputs:
  WebEndpoint:
    Description: 'API Gateway endpoint URL for Prod stage'
    Value: !Sub 'https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/'
